#! /usr/bin/python
import sys
sys.path.append('Php/')
from Cake import Model, Controller
from PyQt4 import QtGui, QtCore

class MainWindow(QtGui.QWidget):
	def __init__(self, parent = None):
		QtGui.QWidget.__init__(self, parent)
		# configure the window
		#self.resize(250, 150)
		self.setWindowTitle('The Oven')
		
		# create buttons
		self.quit_btn = QtGui.QPushButton('Close', self)
		self.save_btn = QtGui.QPushButton('Save', self)
		
		# create labels and edit boxes
		self.contName = QtGui.QLabel('Controller Name:')
		self.contNameEdit = QtGui.QLineEdit()
		
		# layout
		self.grid = QtGui.QGridLayout()
		self.grid.setSpacing(10)
		
		self.grid.addWidget(self.contName, 1, 0)
		self.grid.addWidget(self.contNameEdit, 1, 1, 1, 2)
		
		self.grid.addWidget(self.quit_btn, 2, 1)
		self.grid.addWidget(self.save_btn, 2, 2)
		
		self.setLayout(self.grid)
		#self.resize(350, 300)
		
		# connections
		self.makeConnections()

		self.show()
	
	def save(self):
		print 'save'
	
	def makeConnections(self):
		self.connect(self.quit_btn, QtCore.SIGNAL('clicked()'),
			QtGui.qApp, QtCore.SLOT('quit()'))
			
		self.connect(self.save_btn, QtCore.SIGNAL('clicked()'),
			self, QtCore.SLOT('save()'))

app = QtGui.QApplication(sys.argv)
test = CakeGui()
sys.exit(app.exec_())
